package com.google.code.chaotic.server;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.google.code.chaotic.client.LoginDto;
import com.google.code.chaotic.shared.AuthException;

//

/**
 * @deprecated Instead, I'm using RPC now!
 */
public final class LoginServlet extends HttpServlet {

	public void doPost( //
			HttpServletRequest request, HttpServletResponse response) //
			throws ServletException, IOException {

		String username = request.getParameter("username");
		String password = request.getParameter("password");
		try {
			LoginDto loginDto = new AuthSvcImpl().login(username, password);
			request.getRequestDispatcher("/Admin.html")//
					.forward(request, response);

		} catch (AuthException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
